<?php

declare(strict_types=1);

/**
 * @Author:     Frank
 * @contact     frank_hhm@163.com
 * @Date:       2023-02-16 11:09:43
 * @Last Modified time: 2023-02-16 14:31:27
 */
namespace app\common\model\pay;

use frank\base\BaseModel;
use frank\traits\ModelTrait;
use app\common\enum\EnumFactory;

/**
 * 支付 - 退款
 * Class RefundModel
 * @package app\common\model\pay
 */
class RefundModel extends BaseModel
{
    use ModelTrait;

    /**
     * 数据表主键
     */
    protected $pk = 'id';

    /**
     * 模型名称
     */
    protected $name = 'pay_refund';

    /**
     * 支付类型修改器
     */
    public function getPayTypeAttr($value)
    {
        return EnumFactory::instance('pay.type')->getItem($value);
    }

    /**
     * out_refund_no搜索器
     */
    public function searchOutRefundNoAttr($query, $value)
    {
        $query->where('out_refund_no', $value);
    }
}
